import request from '@/utils/request'

// 查询建筑列表
export function listBuilding(query) {
  return request({
    url: '/org/building/list',
    method: 'get',
    params: query
  })
}

// 查询建筑详细
export function getBuilding(id) {
  return request({
    url: '/org/building/' + id,
    method: 'get'
  })
}

// 新增建筑
export function addBuilding(data) {
  return request({
    url: '/org/building',
    method: 'post',
    data: data
  })
}

// 修改建筑
export function updateBuilding(data) {
  return request({
    url: '/org/building',
    method: 'put',
    data: data
  })
}

// 删除建筑
export function delBuilding(id) {
  return request({
    url: '/org/building/' + id,
    method: 'delete'
  })
}

// 建筑楼层系统及设备绑定
export function bindDevice(data) {
    return request({
      url: '/org/building/bindDevice' ,
      method: 'post',
      data: data
    })
  }

  // 查询客户列表
  export function getUserManagerList(type) {
    return request({
      url: `/org/user/userList/${type}`,
      method: 'get'
    })
  }
  // 获取建筑楼层列表
export function getBuildingFloorList(buildingId) {
  return request({
    url: `/org/building/floor/list/${buildingId}`,
    method: 'get'
  })
}

// 获取消防设备列表
export function getDeviceTree(buildingId) {
  return request({
    url: `/org/device/tree`,
    method: 'get'
  })
}

// 编辑楼层别名
export function updateBuildFloor(data) {
  return request({
    url: `/org/building/floor`,
    method: 'put',
    data
  })
}

// 楼层详细接口
export function floorInfo(id) {
  return request({
    url: `/org/building/floor/getInfo/${id}`,
    method: 'get'
  })
}

